<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/layouts/default.xhtml">
	<ui:define name="title">#{text['eleveList.title']}</ui:define>
	<ui:param name="menu" value="EleveMenu" />
	<ui:param name="menuleft" value="ListRetardPayMenu"/>
	<ui:define name="bodyId">listRetardPay</ui:define>
	
	<ui:define name="body">
		<div class="col-sm-12">
			<h:form id="editEleve">
				<div class="page-header">
					<div class="row">
						<div class="col-sm-8">
							<h3>#{text['eleveList.heading']}</h3>
						</div>
					
						<div class="col-sm-4 text-right">	
							 <h:selectOneMenu id="mois" styleClass="form-control input-sm" value="#{eleveController.moisPayeNow.id}">
								<f:selectItem itemLabel="#{text['form.select']}" itemValue="" />
								<f:selectItems value="#{eleveController.mois}"	var="mois" 	itemLabel="#{mois.libelle}" itemValue="#{mois.id}" />
								<p:ajax partialSubmit="true" update="@form" listener="#{eleveController.getRetardPayEleves}"/>
							</h:selectOneMenu>
						</div>
					</div>
					
					<h:commandLink action="#{eleveController.printListRetarPay}"  rendered="#{p:ifGranted('ROLE_ADMIN')}">
						<span class="label label-primary">
				  			<span class="glyphicon glyphicon-file"/> #{text['button.print.list.retard']}
				  		</span>
			  		</h:commandLink>
				</div>
				<p:dataTable id="eleves" var="eleve" value="#{eleveController.retardPayEleves}"
					sortBy="#{eleveController.sortColumn}" paginator="true" rows="25"
					paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="10,25,50">
					
					<p:column>
						<f:facet name="header">
							<p:column sortBy="numeroInscription">
								<h:outputText value="#{text['eleve.numInsc']}" />
							</p:column>
						</f:facet>
						<h:outputText value="#{eleve.numeroInscription}" escape="true" />
					</p:column>
					
					<p:column>
						<f:facet name="header">
							<p:column sortBy="nom">
								<h:outputText value="#{text['eleve.nom']}" />
							</p:column>
						</f:facet>
						<h:outputText value="#{eleve.fullName}" escape="true" />
					</p:column>
					
					<p:column>
						<f:facet name="header">
							<p:column sortBy="classe">
								<h:outputText value="#{text['eleve.classe']}" />
							</p:column>
						</f:facet>
						<h:outputText value="#{eleve.groupe.classe.nomClasse}" escape="true" />
					</p:column>
					
					<p:column>
						<f:facet name="header">
							<p:column sortBy="telephoneParent">
								<h:outputText value="#{text['eleve.telephoneParent']}" />
							</p:column>
						</f:facet>
						<h:outputText value="#{eleve.telephoneParent}" escape="true" />
					</p:column>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>